package com.example.shop_2207.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shop_2207.R
import com.example.shop_2207.entity.GoodsEntity

class GoodsAdapter(list:MutableList<GoodsEntity>):BaseQuickAdapter<GoodsEntity,BaseViewHolder>(R.layout.item_goods,list) {
    override fun convert(holder: BaseViewHolder, item: GoodsEntity) {
        holder.setText(R.id.goods_title,item.goods_desc)
        holder.setText(R.id.goods_price,"￥${item.goods_default_price}起")
        Glide.with(context).load(item.goods_default_icon).into(holder.getView(R.id.goods_iv))
    }
}